feat(vscode): support run tests with debug or coverage, list test items in tree structure#738
Merged
9aoy merged 3 commits intoweb-infra-dev:mainfrom Dec 15, 2025
Merged
Conversation
✅ Deploy Preview for rstest-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
ac0bf83 to
b20757d
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR significantly enhances the VSCode extension by adding test debugging and coverage support, improving the test tree visualization, and refactoring the test execution architecture to use separate worker processes for each test run.
Key changes:
- Implements debug and coverage run profiles for tests, enabling developers to debug tests and collect coverage information directly from VS Code
- Restructures the test item tree to hide workspace/project nodes when there's only one, providing a cleaner UI
- Replaces the long-lived worker process with ephemeral workers spawned per test run, enabling test cancellation and better isolation
Reviewed changes
Copilot reviewed 33 out of 35 changed files in this pull request and generated 14 comments.
Show a summary per file
| File | Description |
|---|---|
| pnpm-lock.yaml | Updated dependencies: removed glob package, added tinyglobby and picomatch for file matching, added coverage-istanbul types |
| packages/vscode/tests/suite/workspace.test.ts | Updated test assertions to reflect new tree structure with consolidated folder nodes |
| packages/vscode/tests/suite/progress.test.ts | Simplified test item path and added cancellation token parameter |
| packages/vscode/tests/suite/index.ts | Migrated from callback-based glob to promise-based tinyglobby |
| packages/vscode/tests/suite/index.test.ts | Refactored to use shared toLabelTree helper from helpers.ts |
| packages/vscode/tests/suite/helpers.ts | Enhanced toLabelTree with fileOnly parameter and updated getProjectItems for new structure |
| packages/vscode/tests/suite/config.test.ts | Removed test file (functionality moved to rstest config-based discovery) |
| packages/vscode/src/worker/reporter.ts | Refactored to use birpc event bindings and added CoverageReporter class for VS Code coverage integration |
| packages/vscode/src/worker/logger.ts | Updated to use birpc's asEvent pattern |
| packages/vscode/src/worker/index.ts | Simplified worker initialization to create rstest instance per run instead of maintaining state |
| packages/vscode/src/types.ts | Consolidated types into WorkerInitOptions, removing separate init and run data types |
| packages/vscode/src/testTree.ts | Restructured test item management with separate classes for folders, files, and cases |
| packages/vscode/src/testRunReporter.ts | Added coverage reporting support with onCoverage method and RstestFileCoverage class |
| packages/vscode/src/project.ts | Major refactoring: uses tinyglobby/picomatch for file discovery, implements tree building with folder collapsing |
| packages/vscode/src/master.ts | Creates ephemeral worker per test run, adds debug support with --inspect-wait, implements cancellation via worker termination |
| packages/vscode/src/extension.ts | Updated test run logic to support workspace/project/folder/file/case hierarchy, added deactivate function |
| packages/vscode/src/config.ts | Removed testFileGlobPattern setting (now read from rstest config) |
| packages/vscode/package.json | Updated dependencies and removed testFileGlobPattern configuration option |
| packages/vscode/README.md | Updated configuration table to reflect removed setting |
| packages/coverage-istanbul/tsconfig.json | Enabled declarationMap for better debugging |
| packages/coverage-istanbul/src/provider.ts | Added support for reporter objects (not just names/arrays) |
| packages/coverage-istanbul/rslib.config.ts | Added conditional source map generation |
| packages/coverage-istanbul/package.json | Added SOURCE_MAP environment variable to dev script |
| packages/core/src/types/coverage.ts | Extended reporter types to accept ReportBase objects |
| packages/core/src/pool/index.ts | Cleared reporters array when serializing runtime config to avoid serialization issues |
| packages/core/src/pool/forks.ts | Added SIGTERM handler for graceful worker shutdown |
| packages/core/package.json | Added istanbul-lib-report types |
| packages/core/LICENSE.md | Updated magic-string repository URL |
| e2e/basic/test/meta.test.ts | Updated path expectations to be relative to project root |
| e2e/basic/test/filePath.test.ts | Updated path expectations to be relative to project root |
| e2e/bail/index.test.ts | Fixed test log filtering to be more specific |
| .vscode/tasks.json | Restructured build tasks with proper dependencies and added rslib problem matcher |
| .vscode/launch.json | Updated pre-launch task reference and disabled autoAttachChildProcesses |
| .vscode/extensions/rslib-problem-matcher/package.json | Added custom problem matcher for rslib watch mode |
| .gitignore | Updated to include .vscode/extensions directory |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
2 tasks
fi3ework
reviewed
Dec 15, 2025
Member
|
cc @9aoy , coverage reporter now can accept an instance, i think it's nice to have that. PTAL. |
9aoy
approved these changes
Dec 15, 2025
Collaborator
|
👏 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
depends on #720
New Features
--inspect-waitargumenttinyglobby, then watches changes with the VSCode watcher, and filters files withpicomatch20251205-202829.mp4
Related Links
Checklist